You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Small language models (SLM) fit local/edge/low-cost niches. This PR adds an explicit subtask-class router: high-frequency, low-complexity subtasks (tool-result cleanup, summarization, classification) should ride the SLM path, while deep reasoning stays on the LLM path.
Components
core/loop/slm_routing.py (new, 152 lines)
Pure decision mechanism:
route_subtask(task_class, ...) -> RoutingDecision
Subtask classes: simple / medium / complex
Env-tunable model overrides: DEEPCODE_SLM_MODEL, DEEPCODE_LLM_MODEL
DEEPCODE_SLM_ROUTING=0 disables SLM routing (falls back to LLM tier)
core/loop/slm_tasks.py (new, 102 lines)
First consumer: turns the routing decision into a preview-shaping policy for oversized tool results — when cleanup is SLM-grade, the persisted preview is shaped as a clean dense digest; when LLM-grade, raw truncation stays.
Design
Zero network, zero async — decision-only, deployment-adaptable
Route by task complexity, not by caller identity
Clean separation: routing decision vs. execution channel
Thank you for the submission, @raymondginger2018-sudo. Closing this implementation, but noting the direction. Two facts about the current tree: there is no SLM channel (sub-agents inherit the parent model in core/harness/agents/control.py), and the module's "consumer" path never calls a model — it is a regex-based truncation with a different name — so merging it would add configuration without behaviour. The PR description also refers to an existing small-model risk gate that we could not find in the repository. The idea itself (a cheaper model tier for compaction summaries and simple sub-agents) is worth doing; we have recorded it as a planned provider-layer change (a model tier on the phase routing in core/config.py), which is where it belongs. If you would like to take that on, start from model_for_phase / make_llm_provider(phase=...) and include an end-to-end test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Small language models (SLM) fit local/edge/low-cost niches. This PR adds an explicit subtask-class router: high-frequency, low-complexity subtasks (tool-result cleanup, summarization, classification) should ride the SLM path, while deep reasoning stays on the LLM path.
Components
core/loop/slm_routing.py(new, 152 lines)Pure decision mechanism:
route_subtask(task_class, ...) -> RoutingDecisionsimple/medium/complexDEEPCODE_SLM_MODEL,DEEPCODE_LLM_MODELDEEPCODE_SLM_ROUTING=0disables SLM routing (falls back to LLM tier)core/loop/slm_tasks.py(new, 102 lines)First consumer: turns the routing decision into a preview-shaping policy for oversized tool results — when cleanup is SLM-grade, the persisted preview is shaped as a clean dense digest; when LLM-grade, raw truncation stays.
Design
Files
core/loop/slm_routing.pycore/loop/slm_tasks.pyPart of GenAI lesson 19 SLM/LLM cost-tier family.